<?
	require 'vkapi.class.php';
	
	$api_id = 2415458; // Insert here id of your application
	$secret_key = 'GforD8mO4tS4Elk5okWM'; // Insert here secret key of your application
	
	$VK = new vkapi($api_id, $secret_key);
	
	$uid = $_REQUEST['uid'];
	
	$resp = $VK->api('secure.getBalance', array('random' => rand(), 'timestamp' => time(), 'uid' => $uid ) );
	print_r($resp);
	
	if ($resp['response'] != 0){
		$resp = $VK->api('secure.withdrawVotes', array('timestamp' => time(), 'random' => rand(),  'uid'=> $uid, 'votes' => $resp['response']));
		print_r($resp);
	}
?>
